package cn.jbt.api.admin.controller;

import cn.jbt.api.admin.entity.XxlJobGroup;
import cn.jbt.api.admin.service.IXxlJobGroupService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/xxlJob/common")
@Slf4j
@AllArgsConstructor
public class XxlJobCommonController {

    private final IXxlJobGroupService iXxlJobGroupService;

    /**
     * <h2>查询执行器列表</h2>
     */
    @PostMapping("/jobGroups")
    public List<XxlJobGroup> getJobGroups(@RequestBody XxlJobGroup xxlJobGroup) {
        return iXxlJobGroupService.getAll(xxlJobGroup);
    }


}
